#pragma once
#include <QDialog>
#include "ui_parameter_editor.h"
/*
#include <QtGui/QMainWindow>
#include <QtGui/QWidget>


#include <qwt_plot_canvas.h>
#include <qwt_legend.h>
#include <qwt_plot_grid.h>
#include <qwt_plot_curve.h>
#include <qwt_symbol.h>
#include <vector>*/

/*using namespace std;*/

class Editor : public QDialog
{
	Q_OBJECT
private:
	Ui::editorDialog ui;


	vector<QTableWidgetItem *> x, y;
public:
	Editor(QWidget* pwgt = 0);	
	~Editor();

	QString getData();
	void setData(const QString &name, const QString &text);
	
private slots:

	void on_btnAccept_clicked();
	void on_btnReject_clicked();
	void on_btnLoad_clicked();
	void on_btnAddRow_clicked();
	void on_btnRemoveRow_clicked();
	void on_btnRefresh_clicked();
};



class LineEditDelegate : public QItemDelegate{
	Q_OBJECT
public:
	LineEditDelegate(QObject* parent = 0);

	QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const;

	void setEditorData(QWidget* editor, const QModelIndex& index) const;
	void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const;

	void updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const;
};